{% extends "base.html" %}
{% load static %}
{% block title %}电影{% endblock %}

{% block css %}<link rel="stylesheet" href="{% static 'css/search_movie.css' %}">{% endblock %}

{% block content %}

<div class="container">
    <!-- 任务栏 -->
    <div class="taskbar">
        <form class="form" method="get" action="{% url 'search_movie' %}"> 
            <span class="search">
                <input type="text" name="name" placeholder="请输入系列名称" value="{{ request.GET.name }}"> 
                <button type="submit"><img src="{% static 'img/搜索.png' %}" alt=""></button> 
            </span>
        </form> 
        <span class="link-add">
            <a href="/noinfo/add_movie/" target="update-iframe"><img src="{% static 'img/添加.png' %}" alt=""></a>
        </span>
    </div>
        
    <!-- 左侧查询结果页 -->
    <div class="table-text">
        {% if results %}  
        <table>
            <tr class="detail-head">
                <th>名称</th>
                <th>类型</th>
                <th>维度</th>
                <th>时长</th>
                <th>开播日期</th>
                <th>制作公司</th>
                <th>导演</th>
            </tr>
            {% for result in results %}
            <tr class="detail-text">
                <td class="td1"><a href="/noinfo/update_movie/?uid={{ result.id }}" target="update-iframe">{{ result.name | default_if_none:"" }}</a></td>
                <td class="td3">{{ result.playmode | default_if_none:"" }}</td>
                <td class="td3">{{ result.dim | default_if_none:"" }}</td>
                <td class="td3">{{ result.duration | default_if_none:"" }}</td>
                <td class="td2">{{ result.date_start | date:"Y-m-d" }}</td>
                <td class="td2">{{ result.producer | default_if_none:"" }}</td>
                <td class="td2">{{ result.director | default_if_none:"" }}</td>
            </tr>
            {% endfor %}
        </table>
        {% else %}  
        <p>未找到相关结果！</p> 
        {% endif %} 
    </div>

    <!-- 右侧详情页 -->
    <div class="form-info">
      <iframe src="http://127.0.0.1:8000/noinfo/update_movie/?uid=1" name="update-iframe" height="100%" width="100%" scrolling="no" frameborder="0"></iframe>
    </div>

</div>
    
    <script>

    </script>

{% endblock %}